<%@ page import="com.ws.q1.conifg.Res" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改个人信息</title>
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .form-group {
            margin-bottom: 15px;
        }
        .form-control {
            width: 100%;
            padding: 8px;
            box-sizing: border-box;
        }
        .btn-primary {
            background-color: #007bff;
            border-color: #007bff;
            color: white;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
        }
        .btn-primary:hover {
            background-color: #0056b3;
            border-color: #0056b3;
        }
        .alert {
            margin-top: 15px;
        }
        .avatar-preview {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            margin-top: 10px;
            object-fit: cover;
        }
    </style>
</head>
<body>
<div class="container">
    <h2 class="mt-4">修改个人信息</h2>
    <form action="${pageContext.request.contextPath}/denglu/updater" method="post" enctype="multipart/form-data">
        <input type="hidden" name="id" value="${user.id}">

        <div class="form-group">
            <label for="name">用户名：</label>
            <input type="text" class="form-control" id="name" name="name" value="${user.name}" placeholder="请输入用户名" required>
        </div>

        <div class="form-group">
            <label for="pass">密码：</label>
            <input type="password" class="form-control" id="pass" name="pass" placeholder="请输入新密码">
        </div>

        <div class="form-group">
            <label for="phone">手机号：</label>
            <input type="text" class="form-control" id="phone" name="phone" value="${user.phone}" placeholder="请输入手机号" required>
        </div>

        <div class="form-group">
            <label for="avatar">头像</label>
            <input type="file" class="form-control-file" id="avatar" name="image">
            <img src="<%=Res.fileUrl%>${user.tou}" alt="用户头像" style="width: 100px; height: 100px; border-radius: 50%; margin-top: 10px;">
        </div>
        <button type="submit" class="btn btn-primary">保存</button>
    </form>
</div>
</body>
</html>
